//一个java文件中最好只有一个类

class Student1 {
    public String name;
    public int age;
    public double score;
    public String sex;

    public void doClass() {
        System.out.println("上课！");
    }
    public void doHomeWork(){
        System.out.println("写作业");
    }
}
class Student {
    //属性：成员变量 -》 定义在类的内部，方法的外部  成员变量属于对象的
    public string name;
    public int age;
    public double score;
    public string sex;
    //方法
    public void doClass(){
        System.out.println("上课！");
    }
    public void doHomework(){
        System.out.println("写作业！");
    }
}

class GirlFriend{
    public string name;
    public int age;
    public string eyes;

    public void eat(){
        System.out.println("吃火锅！");
    }
}


//public class test 和 cla
//class test 是一样的，都可以运行
public class test {

    public static void main(String[] args) {
        //类名 + 变量= new+类名();   实例化对象  或者称之为 创建一个变量    （）带小括号是调用方法
        Student student1 = new Student(); //变量就是引用变量
        student1.age = 10;
        student1.name = "bit";
        student1.sex = "男";
        student1.score = 98.5;

        Student student2 = new Student();
        student2.name = "mengqi";
        student2.age = 20;
        student2.score = 99.9;
        student2.sex = "男"；
        student2.doClass();
        student2.doHomework();

    }




    public static void main1(String[] args) {
        //通过new关键字，实例化多个对象
        Student student1 = new Student();//学生实体，学生对象
        Student student2 = new Student();
        Student student3 = new Student();
        Student student4 = new Student();
        Student student5 = new Student();




    }


}
